package com.pfdu.simplescheduler.strategy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class FilterContext {
    public static final String DEFAULT = "default";

    @Autowired
    private DefaultFilter defaultFilter;
    @Autowired
    private IdHashFilter idHashFilter;


    public FilterStrategy choose(String strategy) {
        strategy = strategy.toLowerCase();
        switch (strategy){
            case "hash":
                return idHashFilter;
            default:
                return defaultFilter;
        }
    }
}
